// config.ts
import * as fs from 'fs';
import * as path from 'path';
export interface AppConfig {
  port: number;
  host: string;
  U9WebApi: string;
  DB: {
    HOST: string;
    PORT: number;
    USERNAME: string;
    PASSWORD: string;
    DATABASE: string;
  };
  U9DB: {
    HOST: string;
    PORT: number;
    USERNAME: string;
    PASSWORD: string;
    DATABASE: string;
  };
  Redis: {
    HOST: string;
    PORT: number;
    PASSWORD: string;
  };
  Token: {
    SECRET: string;
  };
  thInfo: {
    EnterpriseId: string;
    EnterpriseName: string;
    OrgId: string;
    OrgCode: string;
    OrgName: string;
    UserID: string;
    UserCode: string;
    clientid: string;
    clientsecret: string;
  };
  lfInfo: {
    EnterpriseId: string;
    EnterpriseName: string;
    OrgId: string;
    OrgCode: string;
    OrgName: string;
    UserID: string;
    UserCode: string;
    clientid: string;
    clientsecret: string;
  };
}

// 假设 JSON 文件位于与 config.ts 相同的目录下
const filePath = path.join(__dirname, '../../config.dev.json');

// 读取 JSON 文件并解析其内容
const configData: AppConfig = JSON.parse(fs.readFileSync(filePath, 'utf8'));

// 导出配置对象
export default configData;
